<!DOCTYPE html>
<html lang='en' ng-app='app'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title> 个人博客 </title>
    <link rel='stylesheet' href='x_bs/css/bootstrap.css'>
    <link rel="shortcut icon" href="source/images.png"/>
    <style>
        li {
            margin: 0px 0px 0px 10px;
        }

        .input-group .form-control {
            margin-bottom: -3px;
        }

        .dropdown-menu {
            background: #a6e1ec
        }
    </style>

</head>
<body class="bg-info" style="padding-top: 70px">
<div class="container" id="app">
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#myCollapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="#" class="navbar-brand btn">个人博客</a>
            </div>
            <div class="collapse navbar-collapse" id="myCollapse">
                <ul class="nav navbar-nav">
                    <li><a href="#" @click="getMsg">git命令</a></li>
                    <li class="dropdown">
                        <a href="#" data-toggle="dropdown">
                            随笔
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#" @click="getMsg">css3问题点</a></li>
                            <li><a href="#" @click="getMsg">常用文档</a></li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a href="#" data-toggle="dropdown">
                            速查表
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#" @click="getMsg">keycode速查表</a></li>
                        </ul>
                    </li>
                </ul>
                <!--搜索框-->
                <form action="#" class="navbar-form navbar-right">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="百度一下" disabled="disabled">
                        <button class="btn btn-danger" data-toggle="modal" data-target="#myModal">search</button>
                    </div>
                </form>
            </div>
        </div>
    </nav>
    <!--模态框内容-->
    <div class="modal fade" id="myModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <h4 class="modal-body">
                        点我干嘛？
                        <button class="close" data-dismiss="modal">
                            <span>&times;</span>
                        </button>
                    </h4>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <div id="text" class="bg-default"></div>
</div>
</body>
</html>
<script src="source/vue/vue.js"></script>
<script src="source/vue/vue-resource.js"></script>
<script src='x_bs/js/jquery.1.12.4.js'></script>
<script src='x_bs/js/bootstrap.js'></script>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            url:[
                    "html/git命令.html",
                    "html/css3问题点.html",
                    "html/常用文档.html",
                    "html/keycode速查表.html"
                ]
        },
        methods: {
            getMsg:function(){
                for(let i=0;i<this.url.length;i++){
                    if("html/"+event.target.innerHTML+".html"==this.url[i]){
                        this.$http.get(this.url[i]).then(function(res){
                            //console.log(res.statusText);
                            $("#text").html(res.body)
                        },function(err){
                            console.log(err)
                        })
                    }
                }
            }
        },
    })
</script>